@use '@scss/common' as *;

.wrapper {
  position: relative;
}

.mainGutter {
  position: relative;
}

.card {
  position: relative;
  padding-top: 4rem;

  &.isFirst {
    margin-top: -12rem;
    grid-column: 1/-1;
    grid-row: 1/1;
  }

  & .media {
    margin-right: calc(var(--gutter-h) / -1 + 1px);

    img {
      right: -1px;

      @include mid-break {
        right: unset;
      }
    }

    @include mid-break {
      margin-right: 1px;
      margin-left: 1px;
    }
  }

  &:last-of-type {
    padding-bottom: 4rem;

    @include mid-break {
      padding-bottom: 0;
    }
  }
}

.stickyBlock {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  grid-column: 1/-1;
  grid-row: 1/1;
  pointer-events: none;
  align-items: center;

  @include mid-break {
    display: none;
  }
}

.stickyBlockItem {
  grid-column: 1/9;
  grid-row: 1/1;
  opacity: 0;
  visibility: hidden;
  position: relative;
  will-change: opacity, visibility;
  transition:
    opacity 0.35s ease-in-out,
    visibility 0.35s ease-in-out;

  &.isVisible {
    pointer-events: all;
    opacity: 1;
    transition: all 0.35s;
    visibility: visible;
  }
}

.quoteIcon {
  position: absolute;
  width: 10rem;
  height: auto;
  color: var(--theme-bg);
  left: -2.4rem;
  top: -5.6rem;

  @include large-break {
    left: -1.8rem;
    top: -4.5rem;
    width: 8rem;
  }

  @include mid-break {
    display: none;
  }

  & path {
    stroke: var(--theme-elevation-200);
    stroke-width: 1px;
    vector-effect: non-scaling-stroke;
  }
}

.quote {
  @include h3;
  & {
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 2rem;
    position: relative;
    letter-spacing: -0.04em;
  }

  @include small-break {
    margin-bottom: 1rem;
  }
}

.scanlineWrapper {
  overflow: hidden;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;

  @include mid-break {
    display: none;
  }
}

.mainTrack {
  scroll-snap-type: y mandatory;
  position: relative;
  scroll-snap-align: center;
  overflow: visible;
  row-gap: 12rem;

  padding-top: 16rem;
  padding-bottom: 10rem;

  margin-bottom: -80vh;

  @include mid-break {
    margin-bottom: 0;
    row-gap: 4rem;
    padding-top: 1rem;
    padding-bottom: 0;
  }
}

.media {
  position: relative;

  & img {
    object-fit: cover;
    position: relative;
  }
}

.mobileQuoteItem {
  display: none;
  margin-top: 2rem;

  @include mid-break {
    display: grid;
  }
}

.caseStudyButton {
  width: 100%;

  @include small-break {
    width: calc(100% - 1px);
  }
}

.authorWrapper {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;

  @include small-break {
    margin-bottom: 1rem;
  }
}

.author {
  opacity: 0.8;
  line-height: 1.2;

  @include small-break {
    @include small;
  }
}

.navWrapper {
  position: sticky;
  height: 80vh;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: flex-end;
  margin-left: calc(var(--gutter-h) / -1);
  margin-right: calc(var(--gutter-h) / -1);
  pointer-events: none;

  @include mid-break {
    display: none;
  }
}

.nav {
  position: relative;
  border-top: 1px solid var(--theme-elevation-200);
  background-color: var(--theme-bg);
  width: 100%;
  pointer-events: all;
}

.navGrid {
  position: relative;

  @include mid-break {
    scroll-behavior: smooth;
    overflow-x: scroll;
    grid-template-columns: repeat(4, calc(100vw - var(--gutter-h) * 2 - var(--scrollbar-width)));
  }
}

.progressIndicator {
  grid-column: 1 / -1;
  position: relative;

  &::before {
    content: '';
    height: 2px;
    background: var(--theme-elevation-1000);
    position: absolute;
    top: -1px;
    left: 0;
    z-index: 7;
    transition: width 0.05s linear;
    will-change: width;
    width: calc(var(--progress-width));
  }
}
.navBackgroundGrid {
  z-index: 5;

  @include mid-break {
    & > *:first-of-type {
      display: none;
    }
  }
}

.navItem {
  @include mid-break {
    width: 100%;

    &:nth-of-type(2) {
      grid-column: 1/2;
    }

    &:nth-of-type(3) {
      grid-column: 2/3;
    }

    &:nth-of-type(4) {
      grid-column: 3/4;
    }

    &:nth-of-type(5) {
      grid-column: 4/5;
    }
  }

  .navButton {
    border-top: none;
    width: 100%;

    &:hover {
      & .navButtonLabel {
        opacity: 1;
      }
    }

    & .navButtonLabel {
      padding: 0.5rem 0;
      opacity: 0.6;
    }

    &.isActive {
      & .navButtonLabel {
        opacity: 1;
      }
    }
  }
}

.logo {
  max-width: 6rem;
  height: auto;
}
